ifeq ($(shell uname), Darwin)
	export CC=x86_64-elf-gcc
	export LD=x86_64-elf-ld
	export AR=x86_64-elf-ar
	export OBJCOPY=x86_64-elf-objcopy
	export NM=x86_64-elf-nm
else
	export CC=x86_64-linux-gnu-gcc
	export LD=x86_64-linux-gnu-ld
	export AR=x86_64-linux-gnu-ar
	export OBJCOPY=x86_64-linux-gnu-objcopy
	export NM=x86_64-linux-gnu-nm
endif

all: init.elf

init.elf: init.c
	$(CC) -c init.c -o init.o
	$(LD) ../libc/lib/*.o ../libc/lib/*.a init.o -o init.elf
	rm -rf init.o

clean:
	rm -rf *.elf
